import { get, post, put } from '../utils/request'


export const server = {


    //登录
    login: (paramObj) => {
        return post('/v1.Admin/login', paramObj);
    },

    //用户列表
    getAdminList: (paramObj) => {
        return get('/v1.Admin/select', paramObj);
    },
    //用户详情
    detailAdmin: (paramObj) => {
        return get('/v1.Admin/detail/' + paramObj);
    },
    //用户修改
    editAdmin: (id, paramObj) => {
        return put('/v1.Admin/edit/' + id, paramObj);
    },
    //用户添加
    addAdmin: (paramObj) => {
        return post('/v1.Admin/add', paramObj);
    },

    //用户删除
    delAdmin: (paramObj) => {
        return get('/v1.Admin/delete/' + paramObj);
    },

    // 用户批量删除
    delallAdmin: (paramObj) => {
        return get('/v1.Admin/delAll/' + paramObj);
    },

    //用户状态
    statusAdmin: (id, paramObj) => {
        return put('/v1.Admin/status/' + id + '/state/' + paramObj);
    },

    //订单查询
    getOrderList: (paramObj) => {
        return get('/v1.Order/select', paramObj);
    },
    //订单导出
    getExcel: (paramObj) => {

        return get('/v1.Order/exportOrders/' + paramObj);
    },
    //订单状态修改
    updateStatus: (paramObj, status) => {

        return get('/v1.Order/status/' + status + '/ids/' + paramObj);
    },


    //权限查询
    getAuthList: (paramObj) => {
        return get('/v1.Auth/all', paramObj);
    },

    // 权限删除
    delAuth: (paramObj) => {
        return get('/v1.Auth/delete/' + paramObj);
    },

    // 权限添加
    addAuth: (paramObj) => {
        return post('/v1.Auth/add', paramObj);
    },

    // 权限详情
    detailAuth: (paramObj) => {
        return get('/v1.Auth/detail/' + paramObj);
    },

    // 权限修改
    editAuth: (id, paramObj) => {
        return put('/v1.Auth/edit/' + id, paramObj);
    },

    //分类查询
    getCategoryList: (paramObj) => {
        return get('/v1.Category/all', paramObj);
    },

    // 分类删除
    delCategory: (paramObj) => {
        return get('/v1.Category/delete/' + paramObj);
    },

    // 分类添加
    addCategory: (paramObj) => {
        return post('/v1.Category/add', paramObj);
    },

    // 分类详情
    detailCategory: (paramObj) => {
        return get('/v1.Category/detail/' + paramObj);
    },

    // 分类修改
    editCategory: (id, paramObj) => {
        return put('/v1.Category/edit/' + id, paramObj);
    },

    //分类查询

    selCategory: () => {
        return get('/v1.Category/select');
    },
    //参数列表
    getAttr: (id, paramObj) => {
        return get('/v1.Attr/select/' + id, paramObj);
    },
    //参数添加
    addAttr: (paramObj) => {
        return post('/v1.Attr/add', paramObj);
    },

    //参数删除
    delAttr: (id) => {
        return get('/v1.Attr/delete/' + id);
    },

    //参数详情
    detailAttr: (id) => {
        return get('/v1.Attr/detail/' + id);
    },

    //参数修改
    editAttr: (id, paramObj) => {
        return put('/v1.Attr/edit/' + id, paramObj);
    },

    // 执行修改和删除attr_values
    insertAttr: (id, aid, paramObj) => {
        return put('/v1.Attr/insert/' + id + '/attrid/' + aid, paramObj);
    },

    //商品查询
    getGoodsList: (paramObj) => {
        return get('/v1.Goods/select', paramObj);
    },

    // 商品删除
    delGoods: (paramObj) => {
        return get('/v1.Goods/delete/' + paramObj);
    },

    // 商品添加
    addGoods: (paramObj) => {
        return post('/v1.Goods/add', paramObj);
    },

    // 商品详情
    detailGoods: (paramObj) => {
        return get('/v1.Goods/adminDetail/' + paramObj);
    },

    // 商品修改
    editGoods: (id, paramObj) => {
        return put('/v1.Goods/edit/' + id, paramObj);
    },

    //商品状态
    statusGoods: (id, paramObj) => {
        return get('/v1.Goods/status/' + id + '/on_sale/' + paramObj);
    },

    //商品推荐
    pstatusGoods: (id, paramObj) => {
        return get('/v1.Goods/pstatus/' + id + '/propaganda/' + paramObj);
    },

    //数据统计
    getIndex: () => {
        return get('/v1.Index/index');
    },

    //折线图
    getEcharts: () => {
        return get('/v1.Index/echarts');
    },

    //优惠卷列表
    getCoupons: (paramObj) => {
        return get('/v1.Coupons/sel', paramObj);
    },
    //优惠卷添加
    addCoupons: (paramObj) => {
        return post('/v1.Coupons/add', paramObj);
    },

    //优惠卷删除
    delCoupons: (id) => {
        return get('/v1.Coupons/delete/' + id);
    },

    //优惠卷批量删除
    delAllCoupons: (ids) => {
        return get('/v1.Coupons/delAll/' + ids);
    },

    //优惠卷详情
    detailCoupons: (id) => {
        return get('/v1.Coupons/detail/' + id);
    },

    //优惠卷修改
    editCoupons: (id, paramObj) => {
        return put('/v1.Coupons/edit/' + id, paramObj);
    },

    //秒杀列表
    getSeckill: (paramObj) => {
        return get('/v1.Seckill/select', paramObj);
    },
    //秒杀添加
    addSeckill: (paramObj) => {
        return post('/v1.Seckill/add', paramObj);
    },

    //秒杀删除
    delSeckill: (id) => {
        return get('/v1.Seckill/delete/' + id);
    },

    //秒杀批量删除
    delAllSeckill: (ids) => {
        return get('/v1.Seckill/delAll/' + ids);
    },

    //秒杀详情
    detailSeckill: (id) => {
        return get('/v1.Seckill/detail/' + id);
    },

    //秒杀修改
    editSeckill: (id, paramObj) => {
        return put('/v1.Seckill/edit/' + id, paramObj);
    },

    //秒杀状态
    statusSeckill: (id, paramObj) => {
        return put('/v1.Seckill/status/' + id + '/state/' + paramObj);
    },

    //获取已有的秒杀商品
    getSeckillGoods: (paramObj) => {
        return get('/v1.Seckill/goods?id=' + paramObj);
    },
    //获取秒杀商品
    getSelGoods: (paramObj) => {
        return get('/v1.Seckill/selgoods', paramObj)
    },
    //秒杀商品添加
    addSeckillGoods: (id, paramObj) => {
        return post('/v1.Seckill/goods/' + id, paramObj);
    },

    //秒杀商品删除
    delSeckillGoods: (id, paramObj) => {

        return get('/v1.Seckill/delgoods/' + id + '/id/' + paramObj);
    },


    //轮播图列表
    getBanner: () => {
        return get('/v1.Banner/select');
    },
    //轮播图添加
    addBanner: (paramObj) => {
        return post('/v1.Banner/add', paramObj);
    },

    //轮播图删除
    delBanner: (id) => {
        return get('/v1.Banner/delete/' + id);
    },


    //轮播图详情
    detailBanner: (id) => {
        return get('/v1.Banner/detail/' + id);
    },

    //轮播图修改
    editBanner: (id, paramObj) => {
        return put('/v1.Banner/edit/' + id, paramObj);
    },




}